package com.day15.Grade;

import java.util.Comparator;
import java.util.TreeSet;

public class TreeSetDemo {
    public static void main(String[] args) {
        TreeSet<Student> ts=new TreeSet<Student>(new Comparator<Student>() {
            @Override
            public int compare(Student o1, Student o2) {
                return 0;
            }
        });
        Student s1=new Student("张三",20,80);
        Student s2=new Student("李四",21,90);
        Student s3=new Student("王五",22,70);
        Student s4=new Student("赵六",23,60);
        Student s5=new Student("钱七",24,50);
        Student s6=new Student("孙八",25,40);
        Student s7=new Student("周九",26,30);
        ts.add(s1);
        ts.add(s2);
        ts.add(s3);
        ts.add(s4);
        ts.add(s5);
        ts.add(s6);
        ts.add(s7);
        for(Student s:ts){
            System.out.println(s.getName()+","+s.getChinese()+","+s.getMath());
        }
    }
}
